package my.mark.mybaibaoxiang.eventDemo.custom.listener;

import my.mark.mybaibaoxiang.eventDemo.custom.ApplicationListener;
import my.mark.mybaibaoxiang.eventDemo.custom.EventListener;
import my.mark.mybaibaoxiang.eventDemo.custom.RegistEvent;
import my.mark.mybaibaoxiang.eventDemo.tests.TestDomain;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 同一个事件可以有多个监听！！！
 *
 * 518活动注册发送限时加息券
 * @Author wxming
 * @Date 2019年5月11日 下午12:29:24
 */
@EventListener
public class RegistEvent518ActivityListener implements ApplicationListener<RegistEvent> {
    private final Logger LOG = LoggerFactory.getLogger(RegistEvent518ActivityListener.class);

    @Override
    public void onApplicationEvent(RegistEvent event) {
        TestDomain customer = (TestDomain) event.getSource();
        //显示加息券通知
        try {
            LOG.info("================执行注册就发送活动券的方法===");
        } catch (Exception e) {
            throw new RuntimeException("518活动显示加息券发送失败", e);
        }
    }

}
